package com.oocl.crm.command.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.exception.ParameterErrorException;

/**
 * D 指令
 * @author GANAB

 */
public class DeleteCommand extends Command{
	public DeleteCommand() {}
	
	public DeleteCommand(String params) {
		super(params);
	}
	
	/**
	 * 获取分离用户ID
	 * @return
	 * @throws ParameterErrorException
	 */
	public Integer getUserId() throws ParameterErrorException{
		if(this.getParams()!=null){
			//校验格式
			if(this.getParams().matches("[0-9]+")){
				//正则已经能排除格式问题，直接取数据
				Integer userId = Integer.parseInt(this.getParams());
				if(userId != null){
					return userId;
				}
			}
		}
		throw new ParameterErrorException("Delete user exception: parameter does not conform to the format! ");
	}
	

}
